﻿<Window x:Class="UofCASE.AgileProductLinerDSL.MappingAcceptanceTestSelector"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:UofCASE.AgileProductLinerDSL"
             mc:Ignorable="d"
             ResizeMode="CanResizeWithGrip"
             ShowInTaskbar="False"
             WindowStartupLocation="CenterOwner" Margin="0" Padding="0" Height="400" Width="600" Background="LightSteelBlue" SizeToContent="Manual" MinHeight="40" Title="Map to acceptance test in current Solution">
    <Window.Resources>
        <HierarchicalDataTemplate DataType="{x:Type local:MappingTreeNode}" ItemsSource="{Binding Path=Children}">
            <StackPanel Orientation="Horizontal">
                <Image Source="{Binding Path=Icon, NotifyOnTargetUpdated=True}"/>
                <TextBlock Name="textBlock" Text="{Binding Path=Name}" Margin="3,0,0,0">
                    <TextBlock.Style>
                        <Style>
                            <Style.Triggers>
                                <DataTrigger Binding="{Binding IsMapped}" Value="True">
                                    <Setter Property="TextBlock.Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                                </DataTrigger>
                            </Style.Triggers>
                        </Style>
                    </TextBlock.Style>
                </TextBlock>
            </StackPanel>
        </HierarchicalDataTemplate>
    </Window.Resources>
    <Grid Margin="5" MinHeight="40">
        <Grid.RowDefinitions>
            <RowDefinition Height="*"></RowDefinition>
            <RowDefinition Height="35" MinHeight="35"></RowDefinition>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" VerticalContentAlignment="Stretch">
            <TreeView Name="treeView" Grid.Row="0" VerticalContentAlignment="Stretch">
                <TreeView.ItemContainerStyle>
                    <Style TargetType="TreeViewItem">
                        <Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=OneWayToSource, UpdateSourceTrigger=PropertyChanged, FallbackValue=True}"/>
                    </Style>
                </TreeView.ItemContainerStyle>
            </TreeView>
        </ScrollViewer>
        <WrapPanel Grid.Row="1" Grid.Column="0" HorizontalAlignment="Stretch" VerticalAlignment="Center" FlowDirection="RightToLeft">
            <Button Content="Cancel" Height="22" HorizontalAlignment="Right" Name="cancel" VerticalAlignment="Center" Width="101" IsCancel="True" Margin="0,0,10,0" />
            <Button Content="Map to test" Height="22" HorizontalAlignment="Right" Name="mapTest" VerticalAlignment="Center" Width="98" IsDefault="True" Click="OnMapTestClick" />
        </WrapPanel>
    </Grid>
</Window>
